angular.module("app").controller("aboutCtrl", ['$scope', function($scope) {

	$scope.$on('$viewContentLoaded', function(event) {

		mui.previewImage();

	});

	if($scope.isapp) {
		wv.set_title("关于我们")

	}

	var swiper = new Swiper('.swiper-container', {

		slidesPerView: 3,
		paginationClickable: true,
		spaceBetween: 30,
		observer: true,
		observeParents: true,

	});
	/*初始化slider*/
	var Slider = mui('#productTab').slider()
	$scope.$on('$viewContentLoaded', function(event) {
		setTimeout(function() {
			/*设置滚动区域高度*/
			$('.mui-content').css('height', $(window).height() - 44 + 'px')
			if($scope.isapp) {
				$('.mui-slider-group').css('height', $(window).height() - $('.mui-slider-group').offset().top + 'px');
				$('.mui-scroll').css('min-height', $(window).height() - $('.mui-slider-group').offset().top + 'px')
			} else {
				$('.mui-slider-group').css('height', $(window).height() - $('.mui-slider-group').offset().top + 'px');
				$('.mui-scroll').css('min-height', $(window).height() - $('.mui-slider-group').offset().top + 'px')
			}

			mui('.mui-scroll-wrapper').scroll({
				scrollY: true, //是否竖向滚动
				scrollX: false, //是否横向滚动
				startX: 0, //初始化时滚动至x
				startY: 0, //初始化时滚动至y
				indicators: true, //是否显示滚动条
				deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
				bounce: true //是否启用回弹
			});
		}, 200)

	})

	/*手动触发滑动*/
	$(".product_Tab_Title").find("span").on("click", function() {
		Slider.gotoItem($(this).index())
		$(".product_Tab_Title").find("span").eq($(this).index()).addClass("mui-active").siblings().removeClass("mui-active")
	})
	/*监听事件*/
	$('#productTab').on("slide", function(e) {
		$(".product_Tab_Title").find("span").eq(e.detail.slideNumber).addClass("mui-active").siblings().removeClass("mui-active")
	})

}])